API - CoTemplate\Cotpl_data
system\cotemplate.php at line 866

Class Cotpl_data

Cotpl_data

public class Cotpl_data

A simple nameless block of data which may parse variables

Field Summary
protected array Block data consisting of strings and Cotpl_vars

$chunks

protected static bool Enables space removal for compact output

$cleanup_enabled

Constructor Summary
void

__construct(string code)

Block constructor

Method Summary
string

__toString()

TPL representation for debugging

array

getTags()

Returns the list of tag names present in data block

static void

init(bool Enables, bool cleanup_enabled)

Initializes static class configuration

string

text(XTemplate tpl)

Returns parsed block contents

private string

cleanup(string html)

Trims spaces before and after tags

Field Detail

system\cotemplate.php at line 871

chunks

protected array Block data consisting of strings and Cotpl_vars $chunks = array()

system\cotemplate.php at line 875

cleanup_enabled

protected static bool Enables space removal for compact output $cleanup_enabled = false

Constructor Detail

system\cotemplate.php at line 882

__construct

public void __construct(string code)
Block constructor
Parameters:
code - TPL contents

Method Detail

system\cotemplate.php at line 907

__toString

public string __toString()
TPL representation for debugging
Returns:

system\cotemplate.php at line 928

getTags

public array getTags()
Returns the list of tag names present in data block
Returns:

system\cotemplate.php at line 945

init

public static void init(bool Enables, bool cleanup_enabled)
Initializes static class configuration
Parameters:
Enables - space removal for compact output

system\cotemplate.php at line 956

text

public string text(XTemplate tpl)
Returns parsed block contents
Parameters:
tpl - Reference to XTemplate object
Returns:
Block data

system\cotemplate.php at line 979

cleanup

private string cleanup(string html)
Trims spaces before and after tags
Parameters:
html - Source HTML
Returns:
Cleaned HTML